package com.guigu.dealservice.service;

import com.github.pagehelper.PageInfo;
import com.guigu.common.utils.R;
import com.guigu.dealservice.entity.PurchaseDemand;
import com.baomidou.mybatisplus.extension.service.IService;
import com.guigu.dealservice.vo.PurchaseDemandVo;

/**
 * <p>
 * 求购信息表（存储买家发布的二手机械求购需求） 服务类
 * </p>
 *
 * @author ysp
 * @since 2025-10-10
 */
public interface PurchaseDemandService extends IService<PurchaseDemand> {

    R queryPurchaseDemandByPage(int pageNum, int pageSize, PurchaseDemandVo purchaseDemandVo);

    R allocatePurchaseDemand(Integer id,Long businessmanId);

    R selectPurchaseByEId(Integer bid);

    //根据求购ID查询求购信息
    R selectPurchaseById(Integer id);

    /**
     * 分页查询求购表
     * @param
     * @return
     */
    PageInfo<PurchaseDemand> queryPurchaseDemandByPagePC(Integer pageNum, Integer pageSize, PurchaseDemandVo purchaseDemandVo);

    /**
     * 前台-发布求购
     */
    R addPurchaseDemand(PurchaseDemand purchaseDemand);

    /**
     * 根据用户id查询我的求购列表
     */
    R queryPurchaseDemandByUserId(Integer pageNum, Integer pageSize,PurchaseDemandVo  vo);

    /**
     * 前台-根据用户id和求购id删除求购信息
     */
    R deletePurchaseDemandByBidAndPid(Integer uid, Integer pid);


    /**
     * 前台-根用户id和求购id修改求购信信息
     */
    R updatePurchaseDemandByBidAndPid(PurchaseDemand purchaseDemand);
    /**
     *
     */

    /**
     * 根据用户id查询求购分页带条件查询
     *
     */
    PageInfo<PurchaseDemand> queryPurchaseDemandByPageUserIdPC(Integer pageNum, Integer pageSize, Long userId, PurchaseDemandVo purchaseDemandVo);
}
